<script>
	export default {
		globalData: {
			openMemberRegister: "", //开放注册 1表示开放注册，0表示关闭注册
			regMustProxyCode: "" // 会员注册时是否必须填写代理推广码 1 必填 0 非必填
		},
		onLaunch: function() {
			console.log('App Launch');
		},
		onShow: function() {
			console.log('App Show');
			this.getLocationAuthorize();
		},
		onHide: function() {
			console.log('App Hide');
		},
		methods:{
			getLocationAuthorize(){
				const appAuthorizeSetting = uni.getAppAuthorizeSetting();
				if(appAuthorizeSetting?.locationAuthorized != "authorized"){//未授权定位服务
					uni.showModal({
						title: '温馨提示',
						content: '请打开手机设置 > 隐私 > 定位服务',
						success: function (res) {
							if (res.confirm) {
								uni.openAppAuthorizeSetting({
									success (res) {
										console.log(res)
									}
								})
							} else if (res.cancel) {
								const platform1 = uni.getSystemInfoSync().platform
								if (platform1 == 'ios') {
									plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
								} else if (platform1 == 'android') {
									plus.runtime.quit();
								}
							}
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	/************************************************************
  ** 请将全局样式拷贝到项目的全局 CSS 文件或者当前页面的顶部 **
  ** 否则页面将无法正常显示                                  **
  ************************************************************/
	@import '@/common/css/index.scss';
</style>